package com.example.mq.factory;

/*
 * @className: SysAbstractMQFactory
 * @author: chentao
 * @date: 2025/3/25 下午4:03
 * @Version: 1.0
 * @description:
 */
public abstract class SysAbstractMQFactory implements SysMQFactory {

    @Override
    public void publish(String exchange, String routingKey, String content) throws Exception {
        if (!getClass().getName().equalsIgnoreCase(SysRabbitMQFactory.class.getName())) {
            throw new Exception("当前方法只有RabbitMQ专用");
        }
    }

    @Override
    public void publish(String queue, boolean isTopic, String content) throws Exception {
        if (!getClass().getName().equalsIgnoreCase(SysActiveMQFactory.class.getName())) {
            throw new Exception("当前方法只有ActiveMQ专用");
        }
    }
}
